//
//  AppGlobalClass.h
//  鱼鱼APP
//
//  Created by User on 15/1/13.
//  Copyright (c) 2015年 User. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface AppGlobalClass : NSObject

/**
 *  服务器地址
 *
 *  @return 服务器地址
 */
+ (NSString *) SharedURL:(NSString *)url;

/**
 *  判断是否是NULL,如果是返回空字符串
 *
 *  @param object 传入参数
 *
 *  @return 返回字符串
 */
+ (NSString *) SharedNullToNSString : (id) object;

/**
 *  访问网络公共方法
 *
 *  @param dic          参数字典
 *  @param view         在哪个页面条用此方法
 *  @param success      成功返回数据
 *  @param failure      返回数据失败
 *  @param networkerror 没有网络
 *
 *  @return 数据字典
 */
+(NSDictionary *)PostDataWithNSstring : (NSString *)actionUrlStr
                       withDictionary : (NSDictionary *) dic
                 withUIViewController : (UIViewController *)viewController
                              success : (void (^)(NSDictionary* dictionary))success
                              failure : (void (^)(NSError *error))failure
                         networkerror : (void (^)(NSString *networkerror))networkerror;

+(NSDictionary *)PostDataWithNSstring : (NSString *)actionUrlStr
                       withDictionary : (NSDictionary *) dic
                              success : (void (^)(NSDictionary* dictionary))success
                              failure : (void (^)(NSError *error))failure
                         networkerror : (void (^)(NSString *networkerror))networkerror;

+(NSString *)PostImagesToServer:(NSString *) strUrl dicPostParams:(NSMutableDictionary *)params dicImages:(NSMutableDictionary *) dicImages;

+ (void)deleteCookie;

+ (NSString *)md5:(NSString *)str;

+ (void)cancleRequest;

+ (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString;

@end
